using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class GamePanel : BasePanel
{
    private static string name = "GamePanel";
    private static string path = "UI/GamePanel";
    public static readonly UIType uIType = new UIType(name, path);

    public GamePanel() : base(uIType)
    {

    }

    public override void OnDestroy()
    {
        base.OnDestroy();
    }

    public override void OnDisable()
    {
        base.OnDisable();
    }

    public override void OnEnable()
    {
        base.OnEnable();
    }

    public override void OnStart()
    {
        base.OnStart();
        UIMethod.GetInstance().GetOrAddComponentInChild<Button>(ActiveObj, "Set").onClick.AddListener(Set);
        UIMethod.GetInstance().GetOrAddComponentInChild<Image>(ActiveObj, "SkillImage").sprite =
            GameRoot.GetInstance().AssetsFactory.LoadSprite(GameRoot.GetInstance().Playername+"Skill");
        UIMethod.GetInstance().GetOrAddComponentInChild<Image>(ActiveObj, "Skill").sprite =
           GameRoot.GetInstance().AssetsFactory.LoadSprite(GameRoot.GetInstance().Playername + "Skill");       
        Player.GetInstance().skilldata = GameRoot.GetInstance().CharacterSkillManager.ReturnSkill(GameRoot.GetInstance().Playername);
        Player.GetInstance().Skill();
        Player.GetInstance().skilldata.SkillImage = UIMethod.GetInstance().GetOrAddComponentInChild<Image>(ActiveObj, "SkillImage");
    }
    private void Set()
    {
        GameRoot.GetInstance().UIManager_Root.Push(new GameSetPanel());
        Time.timeScale = 0;
    }
   
}
